package winform

import (
	"github.com/lxn/walk"
	. "github.com/lxn/walk/declarative"

	"bvethWin"
	"jkmgWin"
	"log"
	"socketWin"
	"tgdzWin"
)

type JKMainWindow struct {
	*walk.MainWindow
}

func MainWindowInit() {

	mw := new(JKMainWindow)

	main := MainWindow{
		AssignTo: &mw.MainWindow,
		Title:    "JMDKINA",
		MinSize:  Size{500, 300},
		Layout:   VBox{},
		Children: []Widget{
			PushButton{
				Text: "数据库操作",
				OnClicked: func() {
					jkmgWin.MongoWindow(mw)
				},
			},
			PushButton{
				Text: "socket学习",
				OnClicked: func() {
					socketWin.NetWindow(mw)
				},
			},
			PushButton{
				Text: "天干地支",
				OnClicked: func() {
					tgdzWin.TgdzOut(mw)
				},
			},
			PushButton{
				Text: "局域网工具",
				OnClicked: func() {
					bvethWin.BvEthWindow(mw)
				},
			},
		},
	}

	err := main.Create()
	if err != nil {
		log.Fatal(err)
	}

	mw.Run()
}
